//写路由首先得需要引入路由模块
import VueRouter from "vue-router";
// 引入vue模块
import Vue from "vue"
// 使用路由模块，将路由模块挂给vue
Vue.use(VueRouter)

var routes = [
    {
        name:"",
        path:"/",
        component:()=> import("../views/LoginView.vue")
    },
    {
        name:"main",
        path:"/main",
        component:()=> import("../views/MainView.vue"),
        children:[
            {
                name:"welcome",
                path:"/homepage/welcome",
                component:()=>import("@/views/homepage/WelcomeView.vue")
            },
            {
                name:"home",
                path:"/menu/home",
                component:()=>import("@/views/menuPage/HomeView.vue")
            },
            {
                name:"detail",
                path:"/menu/detail",
                component:()=>import("@/views/menuPage/DetailPageView.vue")
            },
            {
                name:"combination",
                path:"/menu/combination",
                component:()=>import("@/views/menuPage/CombinationView.vue")
            },
            {
                name:"items",
                path:"/menu/billing/items",
                component:()=>import("@/views/menuPage/billing/BillingItemsView.vue")
            },
            {
                name:"combinations",
                path:"/menu/billing/combinations",
                component:()=>import("@/views/menuPage/billing/BillingCombinationView.vue")
            },
            {
                name:"shopCombination",
                path:"/menu/shopping/shopCombination",
                component:()=>import("@/views/menuPage/shopping/ShopCombinationView.vue")
            },
            {
                name:"shopProject",
                path:"/menu/shopping/shopProject",
                component:()=>import("@/views/menuPage/shopping/ShopProjectView.vue")
            },
            {
                name:"order",
                path:"/menu/person/order",
                component:()=>import("@/views/menuPage/person/OrderView.vue")
            },
            {
                name:"guidanceSheet",
                path:"/guidanceSheet",
                component:()=>import("@/views/menuPage/person/GuidanceSheetView.vue")
            },
            {
                name:"personInfo",
                path:"/personInfo",
                component:()=>import("@/views/menuPage/person/personInfoView.vue")
            },
            
            {
                name:"echart",
                path:"/echart",
                component:()=>import("@/views/menuPage/person/EchartView.vue")
            },
            {
                name:"report",
                path:"/report",
                component:()=>import("@/views/menuPage/person/examinationReport.vue")
            },
        ]

    },
    {
        name:"login",
        path:"/login",
        component:()=> import("../views/LoginView.vue")
    },
    {
        name:"reg",
        path:"/reg",
        component:()=>import("@/views/RegView.vue")
    },
    {
        name:"forgetPwd",
        path:"/forgetPwd",
        component:()=>import("@/views/ForgetPwd.vue")
    },
    

]
// 路由器
var router = new VueRouter({
    mode:"hash",
    routes
})


// 抛出路由器
export default router